<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>绑定class样式</title>
    <script type="text/javascript" src="../js/vue.js"></script>
    <style>
        .basic {
            width: 200px;
            height: 200px;
            font-size: 50px;
            border: 1px solid #ccc;
            text-align: center;
            line-height: 200px;
            margin: 10px;
            transition: all 0.3s;
        }
    </style>
</head>
<body>
    <div id = "app">
        <!--style样式的第一种写法：对象写法-->
        <div class="basic" :style="mood">
            {{content}}
        </div>
        <!--style样式的第二种写法：数组写法，其中mood1,mood2都是样式对象-->
        <div class="basic" :style="[mood1,mood2]">
            {{name}}
        </div>
    </div>
</body>
<script>
    Vue.config.productionTip = false;
    new Vue({
        el: '#app',
        data: {
            content: "这是简介",
            name: "武汉",
            mood: {
                backgroundColor: "red",
                fontSize: "30px"
            },
            mood1:{
                backgroundColor: "blue",
            },
            mood2:{
                fontSize: "20px"
            }
        }
    })
</script>
</html>